package eliminateMaximum;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Solution {
    public int eliminateMaximum(int[] dist, int[] speed) {
        int[] arriveTime = new int[dist.length];
        for (int i = 0; i < dist.length; i++) {
            arriveTime[i] = (dist[i] - 1) / speed[i] + 1;
        }
        Arrays.sort(arriveTime);
        int ans = 0;
        int t = 0;
        int j = 0;
        System.out.println(Arrays.toString(arriveTime));
        while (j<arriveTime.length) {
            if(arriveTime[j] - t<=0) {
                return ans;
            }
            System.out.println(arriveTime[j]-t);
            ans++;
            t++;
            j++;
        }
        return ans;
    }
}
